#ifndef SCOPED_LOCK_HEADER
#define SCOPED_LOCK_HEADER

#include "noncopyable.hpp"

template<typename LockType>
class ScopedLock : public NonCopyable {

    LockType & lock_obj_;

public:

    ScopedLock(LockType &lock)
        :lock_obj_(lock)
    { 
        lock_obj_.lock();
    }

    ~ScopedLock()
    {
        lock_obj_.unlock();
    }
};

#endif
